<?php 
include_once('connection/connection.php');
include('header.php');
include('menu.php');
include('config.php');
$frm=$_SESSION['form_id'];
$id1=$_SESSION['id1'];
$dis_name=$_SESSION['dis_name'];
$qr="select * from tbl_dtls_ufw_main where form_id='$frm'";
$res=mysql_query($qr);
$row1=mysql_fetch_array($res);
   
						
		$qr2="select * from tbl_dtls_ufw_main where id='$id1'";
		$res2=mysql_query($qr2);
		$row2=mysql_fetch_array($res2);
		
if(isset($_POST['back']))
{ 
	header('Location: view_ufw_4.php');
}	
if(isset($_POST['submit']))
{ 
	echo'<span class="successmssg">You have successfully view this Form. Now you can go on <a href="home.php">home</a> page.</span>';
	exit();
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/style_question.css" type="text/css" rel="stylesheet" />
<title>View Q1</title></head>
<body>
<div align="center">
<form action="" method="post" enctype="multipart/form-data">
	<table border="0" width="753" id="table1" cellspacing="0" cellpadding="0">
		<tr>
			<td width="753" height="30" align="center">
				<font face="Verdana" style="font-size: 10pt; font-weight: 700" color="#000000">
				UFW Form</font></td>
		</tr>
		
		<tr>
			<td align="center"><font face="Arial" style="font-size: 8.5pt" color="#000000">page 5</font></td>
		</tr>
		<tr>
			<td><span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">&nbsp;&nbsp;Form Id = <?php echo $frm?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;District Name = <?php echo $dis_name?></font></span></td>
		</tr>
		<tr><td>&nbsp;</td></tr>
		<tr>
<td bgcolor="#EEEEEE" height="22"><font color="#000000">&nbsp;
			</font><span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">
			Cost Detail</font></span></td>
		</tr>
		<tr>
			<td>
			<table border="1" width="750" id="table2" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td colspan="4">
					<span style="font-size: 4pt">&nbsp;</span></td>
				</tr>
				<tr>
					<td width="276" height="25">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;Electricity Cost&nbsp;(<img src="images/26rup1.jpg" width="10">)</font></td>
					<td colspan="3"><font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;<?php echo "$row2[elec_cost]";  ?></font></td>
				</tr>
				<tr>
					<td width="276" height="23">
					 <font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;Man Power Cost&nbsp;(<img src="images/26rup1.jpg" width="10">)</font></td>
					<td colspan="3"><font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;<?php echo "$row2[man_cost]";  ?></font></td>
				</tr>
				<tr>
					<td width="276" height="24">
					 <font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;Chemicals Cost&nbsp;(<img src="images/26rup1.jpg" width="10">)</font></td>
					<td colspan="3"><font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;<?php echo "$row2[chemical_cost]";  ?></font></td>
				</tr>
				<tr>
					<td width="276" height="23">
					 <font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;Maintenance Cost&nbsp;(<img src="images/26rup1.jpg" width="10">)</font></td>
					<td colspan="3"><font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;<?php echo "$row2[maintenance_cost]";  ?></font></td>
				</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td><span style="font-size: 4pt">&nbsp;</span></td>
		</tr>
		<tr>
			<td bgcolor="#EEEEEE" height="22"><span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">
			Remark / Recommendation</font></span></td>
		</tr>
		<tr>
			<td>
			<span style="font-size: 3pt">&nbsp;</span></td>
		</tr>
		<tr>
			<td>
			<table border="1" width="750" id="table6" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td width="37%" height="27">
					<font style="font-size: 8.5pt" face="Verdana" color="#000000">&nbsp;Remarks</font></td>
				  <td colspan="3"><font style="font-size: 8.5pt" face="Verdana" color="#000000">&nbsp;<?php echo "$row2[remark]";  ?></font></td>
				</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td><span style="font-size: 4pt">&nbsp;</span></td>
		</tr>
		<tr>
			<td bgcolor="#EEEEEE" height="22"><span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">
			Upload Index Map and Photos</font></span></td>
		</tr>
		<tr>
			<td><span style="font-size: 4pt">&nbsp;</span></td>
		</tr>
		<tr>
			<td>
			<table border="1" width="750" id="table6" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
			<tr>
					<td width="276" height="23">
					 <font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;Upload Index Map</font></td>
					<td colspan="3"><font style="font-size: 8.5pt" face="Verdana" color="#000000">
				<?php 
				
				  if($row2[index_map]!="")
				  {
				  

                    $qrVillage="select * from tbl_dtls_ufw_src_village where loc_id='$id1'";
                    $resVillage=mysql_query($qrVillage);
                    $rowVillage=mysql_fetch_array($resVillage);
					$Final_Path=$rowVillage['district'] ;
                    $path = "index_map/$Final_Path/"; // change the path to fit your websites document structure
                    $fullPath = $path.$row2['index_map'];
                    //echo  $fullPath;

				  echo $row2['index_map'];?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $fullPath;?>" target="_blank" style="text-decoration:none;color:#006600" ><b>Download</b></a>
				  <?php
				  }
				  ?></font></td>
				</tr>
				<?php 
				if($row2[photos]!="")
				  {
				  	$qrVillage="select * from tbl_dtls_ufw_src_village where loc_id='$id1'";
                    $resVillage=mysql_query($qrVillage);
                    $rowVillage=mysql_fetch_array($resVillage);
					$Final_Path=$rowVillage['district'] ;
                    $path = "photo/$Final_Path/"; // change the path to fit your websites document structure
                    $image=explode(',',$row2['photos']);
					//echo $image[0];
					//echo $image[1];
					//echo count($image);
					for($i=0; $i < count($image); $i++)
					{
					$fullPath = $path.$image[$i];
					?>
				<tr>
					<td width="276" height="23">
					 <font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;Photos</font></td>
					<td colspan="3"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> 
				  
				  
				  <?php echo $image[$i];?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $fullPath;?>" target="_blank" style='text-decoration:none;color:#006600' ><b>Download</b></a>
				  </font></td>
				</tr>
				<?php
				  }
				  }
				  ?>
			</table>
			</td> </tr>
		<tr>
			<td height="7">
			<span style="font-size: 5pt">&nbsp;</span></td>
		</tr>
		
		
		<tr>
          <td height="24"><span style="font-size: 5pt">&nbsp;</span></td>
	  </tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td>
			<p align="center">
			<input type="submit" value="Back" name="back" style="font-size: 8pt;font-family:Verdana; border-style: solid; border-width: 1px">&nbsp;&nbsp;
			<input type="submit" value="Next" name="submit" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px">&nbsp;</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
	</table>
</form>
</div>
</body>
</html>